<template>
    <div>
      <h1>用户登录</h1>
      <input type="text" placeholder="账号" ref="username">
      <input type="password" placeholder="密码" ref="password">
      <button @click="login">登录</button>
    </div>
  </template>
  
  <script>
  export default {
    methods: {
      login() {
      // 登录逻辑
      if (this.$refs.username.value === 'admin' && this.$refs.password.value === '123456') {
        // 登录成功，保存登录状态
        localStorage.setItem('isLoggedIn', 'true');
        // 跳转到学生管理系统页面
        this.$router.push('/studentSystem');
      } else {
        alert('账号或密码错误');
      }}
    }
  }
  </script>